import React, { Component } from 'react'
import PropType from 'prop-types'
import Item from '../item'
import './index.css'

export default class index extends Component {   

    static propTypes={
        todos:PropType.array.isRequired,
        updataDone:PropType.func.isRequired,
        removeListItem:PropType.func.isRequired
    }

    render() { 
        const {todos,updataDone,removeListItem}=this.props    

        return (
            <section>
                <ul className={todos.length>0?'empty':''}>
                    {
                        todos.map(v=>{
                            return <Item key={v.id} {...v} updataDone={updataDone} removeListItem={removeListItem} ></Item>
                        })
                    }
                </ul>
            </section>
        )
    }
}
